Sub 创建目录()
    '关闭屏幕更新加快速度
    Application.ScreenUpdating = False
    Dim i As Integer, Sht_Count
    '如果不存在&ldquo;目录&rdquo;则添加目录工作表
    If Not IsSht("目录") Then Sheets.Add(Sheets(1)).Name = "目录"
    Sht_Count = Sheets.Count    '获取工作表数量
    For i = 2 To Sht_Count    '遍历工作表
        '在&ldquo;目录&rdquo;工作表添加链接
        Sheets("目录").Hyperlinks.Add Anchor:=Sheets("目录").Cells(i - 1, 2), Address:="", SubAddress:="'" & Sheets(i).Name & "'!A1", TextToDisplay:=Sheets(i).Name, ScreenTip:="单击打开：" & Sheets(i).Name
    Next i
    '恢复屏幕更新
    Application.ScreenUpdating = True
    '为返回目录过程指定快捷键为【Ctrl+J】
    'Application.OnKey "^j", "返回目录"
End Sub
'声明一个函数，用于判断是否存在某个指定名称的工作表
Function IsSht(ShtName As String)
    On Error Resume Next
    Dim sht As Worksheet
    Set sht = Sheets(ShtName)
    IsSht = (Err = 0)
End Function
Sub 返回目录()
    '如果有&ldquo;目录&rdquo;则返回&ldquo;目录&rdquo;工作表
    If IsSht("目录") Then Sheets("目录").Select
End Sub